import Vue from 'vue'
import Router from 'vue-router'
import index from '@/components/index/index'
import all from '@/components/index/all'
import classfiy from '@/components/index/classfiy'
import car from '@/components/index/car'
import search from '@/components/index/search'
import my from '@/components/index/my'
import detail from '@/components/detail/detail'
import login from '@/components/login/login'
import loginIndex from '@/components/login/loginIndex'
import regist from '@/components/login/regist'
import detailList from '@/components/detail/detailList'
import itemdetail from '@/components/detail/itemdetail'
import orderList from '@/components/order/orderList'
import orderdetail from '@/components/order/orderdetail'
import coupon from '@/components/order/coupon'
import footmark from "@/components/detail/footmark"
import sealed from "@/components/order/sealed"
import logistics from "@/components/order/logistics"
import withdraw from '@/components/order/withdraw'

Vue.use(Router)

const router = new Router({
  routes: [
    {
      path: '/',
      redirect: {
        name: 'all'
      }
    },
    {
      path: '/index',
      name: 'index',
      component: index,
      children:[{path: '/index/all',component: all,name: 'all'},{path: '/index/classfiy',component: classfiy,name: 'classfiy'},{path: '/index/car',component: car,name: 'car'},{path: '/index/search',component: search,name: 'search'},{path: '/index/my',component: my,name: 'my'}]
    },
    {
      path: '/detail',
      name: 'detail',
      component: detail
    },
    {
      path: '/itemdetail',
      name: 'itemdetail',
      component: itemdetail
    },
    {
      path: '/list',
      name: 'detailList',
      component: detailList
    },
    {
      path: '/order',
      name: 'orderList',
      component: orderList
    },
    {
      path: '/orderdetail',
      name: 'orderdetail',
      component: orderdetail
    },
    {
      path: '/coupon',
      name: 'coupon',
      component: coupon
    },
    {
      path: '/footmark',
      name: 'footmark',
      component: footmark
    },
    {
      path: '/sealed',
      name: 'sealed',
      component: sealed
    },
    {
      path: '/logistics',
      name: 'logistics',
      component: logistics
    },
    {
      path: '/withdraw',
      name: 'withdraw',
      component: withdraw
    },
    {
      path: '/login',
      name: 'login',
      component: login,
      children: [
        {
          path: '/login/login',
          component: loginIndex,
          name: 'loginIndex'
        },
        {
          path: '/login/regist',
          component: regist,
          name: 'regist'
        }
      ]
    }
  ],
  'linkActiveClass': 'active'
})
export default router
